import {createApp} from 'vue'
import App from './App.vue'
import VueCookies from 'vue-cookies'

import router from './router'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'dayjs/locale/zh-cn'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'

import '@/assets/images/icon/iconfont.css'
import Dialog from "@/components/Dialog.vue";
import pinia from "@/stores/index.js";
import Request from "@/utils/Request.js"
import Message from "@/utils/Message.js"
import UserApi from "@/api/user.js"
import Utils from "@/utils/Utils.js";
import Cover from "@/components/Cover.vue";
import Avatar from "@/components/Avatar.vue";
import VideoItem from "@/components/VideoItem.vue";
import DataLoadMoreList from "@/components/DataLoadMoreList.vue";
import NoData from "@/components/NoData.vue";
import Collapse from "@/components/Collapse.vue";
import Confirm from "@/utils/Confirm.js";

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(pinia)
app.use(ElementPlus)
app.use(router)
app.use(Viewer)

app.component("Dialog",Dialog)
app.component("NoData",NoData)
app.component("Cover",Cover)
app.component("Avatar",Avatar)
app.component("VideoItem",VideoItem)
app.component("DataLoadMoreList",DataLoadMoreList)
app.component("Collapse",Collapse)

app.config.globalProperties.VueCookies = VueCookies;
app.config.globalProperties.bodyMaxWidth = 2800;
app.config.globalProperties.bodyMinWidth = 1250;
app.config.globalProperties.loginCopdown = false;
app.config.globalProperties.request = Request;
app.config.globalProperties.message = Message;
app.config.globalProperties.UserApi = UserApi;
app.config.globalProperties.Confirm = Confirm;
app.config.globalProperties.Utils = Utils;
app.config.globalProperties.rowCategoryCount = 9;
app.config.globalProperties.bodyPadding = 150;
app.config.globalProperties.imageAccept = ".JPG,.JPEG,.PNG,.GIF,.BMP,.TIFF,.WEBP,.SVG";
app.config.globalProperties.videoAccept = ".mp4,.lv,.avi,.wmv,.mov,.webm,.mpeg4,.ts,.mpg,.rm,.rmvb,.mkv,.m4v";


app.config.errorHandler = function (err, vm, info) {

};
app.mount('#app')